<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <!-- 求一个数字是否是质数 -->
    <script>
        function Ture(n) {
            var flag = true;
            for (var i = 2; i <= n - 1; i++) {
                if (n % i === 0) {
                    flag = false
                    break
                }
            }
            if (flag) {
                console.log(n + ' 是质数')
            } else {
                console.log(n + ' 不是质数')
            }
        }
        Ture(10)
    </script>
</body>

</html>